package com.example.demo.controller;

import org.springframework.web.bind.annotation.*;

@RequestMapping("/hello")
@RestController
public class HelloController {
    //建立连接
    @RequestMapping(value = "/print",method = RequestMethod.GET)//等于@GetMapping
    public String print(){
        return "hello print";
    }
    @GetMapping
    public String print1(){
        return "helllo print1";
    }

    @RequestMapping(value = "/print",method = RequestMethod.POST)//等于@GetMapping
    public String print2(){
        return "hello print2";
    }
    @PostMapping
    public String print3(){
        return "hello print3";
    }
}

